$(function(){
	
	//点击登录
	$("#loginBtn").click(function(){
		var user=$("#log_uname").val();
		var passw=$("#log_psw").val();
		var uname=strEnc(user,"9","9","9");
		var pwd=hex_md5(passw);
		if(user==""||passw==""){
			return false;
		}
//		location.href="";
		$.ajax({
			url:'loginHandler',
			dataType:'json',
			type:'post',
			data:{username:uname,psw:pwd},
			success:function(data){
				if(data==1){//登录成功，跳转到单笔付款申请
					location.href="danbifukuan";
				}else{
					alert("用户名或密码不正确");
					location.reload();
				}
			},
			error:function(XMLHttpRequest, textStatus, errorThrown) {
				 alert(XMLHttpRequest.status);
				 alert(XMLHttpRequest.readyState);
				 alert(textStatus);
				   },
		});
		
	});
});